<admintpl file="header" />
</head>
<body class="J_scroll_fixed">
	<div class="wrap jj">
		<ul class="nav nav-tabs">
			<li><a href="{:U('menu/index')}">后台菜单</a></li>
			<li><a href="{:U('menu/add')}">添加菜单</a></li>
		</ul>
		<div class="common-form">
			<form method="post" class="form-horizontal J_ajaxForm" action="{:U('Menu/edit_post')}">
				<fieldset>
					<div class="control-group">
						<label class="control-label">上级:</label>
						<div class="controls">
							<select name="parentid" class="normal_select">
								<option value="0">作为一级菜单</option> {$select_categorys}
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">名称:</label>
						<div class="controls">
							<input type="text" class="input" name="name" value="{$data.name}">
							<span class="must_red">*</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">应用:</label>
						<div class="controls">
							<input type="text" class="input" name="app" id="app" value="{$data.app}">
							<span class="must_red">*</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">模块:</label>
						<div class="controls">
							<input type="text" class="input" name="model" id="model" value="{$data.model}">
							<span class="must_red">*</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">方法:</label>
						<div class="controls">
							<input type="text" class="input" name="action" id="action" value="{$data.action}">
							<span class="must_red">*</span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">参数:</label>
						<div class="controls">
							<input type="text" class="input length_5" name="data" value="{$data.data}"> 例:id=3&amp;p=3
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">图标:</label>
						<div class="controls">
							<input type="text" class="input" name="icon" id="action" value="{$data.icon}">
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">备注:</label>
						<div class="controls">
							<textarea name="remark" rows="5" cols="57">{$data.remark}</textarea>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">状态:</label>
						<div class="controls">
							<select name="status" class="normal_select">
								<option value="1" name="data.status">显示</option>
								<php>$status_selected=empty($data['status'])?"selected":"";</php>
								<option value="0" name="data.status" {$status_selected}>隐藏</option>
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">类型:</label>
						<div class="controls">
							<select name="type" class="normal_select">
								<option value="1" name="data.type">权限认证+菜单</option>
								<php>$type_selected=empty($data['type'])?"selected":"";</php>
								<option value="0" name="data.type" {$type_selected}>只作为菜单</option>
							</select>
							注意：“权限认证+菜单”表示加入后台权限管理，纯碎是菜单项请不要选择此项。
						</div>
					</div>
				</fieldset>

				<div class="form-actions">
					<input type="hidden" name="id" value="{$data.id}" />
					<button type="submit" class="btn btn-primary btn_submit  J_ajax_submit_btn">更新</button>
					<button class="btn J_ajax_close_btn" type="submit">关闭</button>
				</div>
			</form>
		</div>
	</div>
	<script src="__ROOT__/statics/js/common.js"></script>
	<script>
		$(function() {
			$(".J_ajax_close_btn").on('click', function(e) {
				e.preventDefault();
				Wind.use("artDialog", function() {
					art.dialog({
						id : "question",
						icon : "question",
						fixed : true,
						lock : true,
						background : "#CCCCCC",
						opacity : 0,
						content : "您确定需要关闭当前页面嘛？",
						ok : function() {
							setCookie('refersh_time_admin_menu_index', 1);
							window.close();
							return true;
						}
					});
				});
			});
		});
	</script>
</body>
</html>